﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;

namespace _4DJackPot
{
    public class Game
    {
        public string gameIdString { get; set; }
        public string gameCreateDate { get; set; }
        public string gameDrawDate { get; set; }

        public Game(string arg_gameIdString)
        {
            this.gameIdString = arg_gameIdString;
            //select query 작성
            string selectQueryString =
                "SELECT DISTINCT created_datetime, draw_datetime FROM games " +
                "WHERE game_id = " + this.gameIdString + "";

            DbConn DbConn = new DbConn();
            DataSet resultReadDataSet = DbConn.ReadQuery(selectQueryString);

            foreach (DataRow row in resultReadDataSet.Tables[0].Rows)
            {
                this.gameCreateDate = row["created_datetime"].ToString();
                this.gameDrawDate = row["draw_datetime"].ToString();
            }
        }

        public WinningNumbers getWinningNumbers()
        {
            WinningNumbers winningNumbers = new WinningNumbers(gameIdString);

            return winningNumbers;
        }


    }
}
